package com.web.model;

import com.jfinal.plugin.activerecord.Model;

import java.util.List;

/**
 * Created by root on 7/27/15.
 */
public class TypeInfo extends Model<TypeInfo>{
    public static final TypeInfo typeInfoDao = new TypeInfo();

    public int getThirdIdByEditor(int editTypeId){
        List<TypeInfo> typeInfoList = typeInfoDao.find("SELECT id FROM type_info WHERE editTypeId=?",editTypeId);

        if(typeInfoList.size()!=1) {
//            System.out.println("没有该分类");
            return 0;
        }else {
            return typeInfoList.get(0).get("id");
        }
    }
}
